import config from '../../utils/config';
import apiCreator from '../../utils/apiCreator';

const api = apiCreator();

export default {
  // 主体信用评级机构
  mainRatingDepart: (query) => api.get(`${config.interfaces.type1}nonstandard/mainRatingDepart`, query),
  // 债项信用评级机构
  debtRatingDepart: (query) => api.get(`${config.interfaces.type1}nonstandard/debtRatingDepart`, query),

  /* 列表相关接口 */
  // 获取列表-非标准化债券类资产
  getAssetTableData: (query) => api.get(`${config.interfaces.type5}instrument-server/nonstandard/queryTable`, query),
  // 获取列表-非标准化债券类投资
  getInvestTableData: (query) => api.get(`${config.interfaces.type5}instrument-server/nonstandard/queryInveTypeTable`, query),
  // 删除
  deleteById: (query) => api.get(`${config.interfaces.type5}instrument-server/nonstandard/deleteOne`, query),
  // 付息计算
  calcFx: (query) => api.post(`${config.interfaces.type5}instrument-server/nonstandard/queryJsFx`, query),
  // 根据id获取数据
  getDataById: (query) => api.get(`${config.interfaces.type5}instrument-server/nonstandard/queryOne`, query),
  // 保存表单接口
  saveData: (query) => api.post(`${config.interfaces.type5}instrument-server/nonstandard/saveData`, query),
  // 查询付息金额
  queryInterestpayment: (query) => api.post(`${config.interfaces.type3}portfolio/autoCalculateInterestpayment`, query),
};
